<template>
    <button @click="click(info.type)">{{ info.name }}</button>
</template>

<script>
import { mapActions } from 'vuex' 
import { addCnt, minusCnt } from '../vuex/actions'

export default {
    props: [ 'info' ],
    methods: {
        click(type) {
           if(type == '+') this.addCnt();
           if(type == '-') this.minusCnt();
        },
        ... mapActions([
            'addCnt',
            'minusCnt'
        ])            
    },
}
</script>

<style scoped>
    button {
        width: 8em;
        border-radius: 6px;
    }
</style>